package p.ithorns.support.license.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * LicenseQo
 * 许可证授权
 *
 * @author Ht.L
 * @date 2023-11-23 17:30
 * @since 1.0.0
 */
@Getter
@Setter
@TableName(value = "sys_license", autoResultMap = true)
public class LicenseEntity implements Serializable {

    @TableId(type = IdType.INPUT)
    private String clientId;

    /**
     * 授权码
     */
    private String authCode;

    /**
     * 序列号
     */
    private String feed;

    /**
     * 到期时间
     */
    //@TableField(value = "expiration", typeHandler = DateTimeTypeHandler.class)
    private LocalDateTime expiration;

    /**
     * 授权参数
     */
//    private String param;

    /**
     * 私钥
     */
    private String privateKey;

    /**
     * 公钥
     */
    private String publicKey;

    /**
     * AES-Key
     */
    private String aesKey;

    /**
     * 创建时间
     */
    //@TableField(value = "create_time", typeHandler = DateTimeTypeHandler.class)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    //@TableField(value = "update_time", typeHandler = DateTimeTypeHandler.class)
    private LocalDateTime updateTime;

    @Override
    public String toString() {
        return "{" +
                "authCode:'" + authCode + '\'' +
                ", expiration:" + expiration +
                "}";
    }
}